package com.szrt.java.day20161226.demo11;


/**
 * 1+2+3+...+10
 *
 */
public class DgDemo {
	
	
	
	public static void main(String[] args) {
		
		
		//xuhan();
		
		int sum  =dg(4);
		System.out.println(sum);
	
		
		
	}
	
	
	public static int dg(int max){
		System.out.println(max);
		if(max>1){
			return max * dg(max-1);
		}else{
			return 1;
		}
		
	}

	public static void xuhan() {
		int sum=0;
		
		int begin=1;
		int end =10;
		while(begin<=end){
			sum = sum + begin;
			begin++;
		}
		
		System.out.println(sum);
	}

}
